import request from '@/config/axios'

export interface MaterialCollectVO {
  id: number
  productNumber: string
  productName: string
  drawingNumber: string
  specification: string
  version: string
  activeData: Date
  stopData: Date
  remark: string
  userNickName: string
}

// 查询物料清单汇总列表
export const getMaterialCollectPage = async (params) => {
  return await request.get({ url: `/config/material-collect/current-page`, params })
}

// 查询物料清单汇总详情
export const getMaterialCollect = async (id: number) => {
  return await request.get({ url: `/config/material-collect/current-details?id=` + id })
}

// 查询物料清单信息
export const getMaterialInfo = async (id: number) => {
  return await request.get({ url: `/config/material-collect/get?id=` + id })
}

// 新增物料清单汇总
export const createMaterialCollect = async (data: MaterialCollectVO) => {
  return await request.post({ url: `/config/material-collect/create`, data })
}

// 修改物料清单汇总
export const updateMaterialCollect = async (data: MaterialCollectVO) => {
  return await request.put({ url: `/config/material-collect/update`, data })
}

// 删除物料清单汇总
export const deleteMaterialCollect = async (id: number) => {
  return await request.delete({ url: `/config/material-collect/delete?id=` + id })
}

// 导出物料清单汇总 Excel
export const exportMaterialCollect = async (data) => {
  return await request.download({ url: `/config/material-collect/export-current-excel`, data })
}

// 导出物料清单汇总详情excel
export const exportMaterialCollectDetail = async (params) => {
  return await request.download({ url: `/config/material-collect/export-current-details-excel`, params })
}
